@extends('layouts.master')

@section("css")
    @parent
    <link rel="stylesheet" type="text/css" href="/css/pages/create.css">
@stop

@section("body")
@include("components.left")
    <div class="create_content">
        <div class="create_title">
            <img src="/images/houtaianliku_12.png">
            修改患者
        </div>
        <div class="create_box">
            <div class="rol_div">
                <div class="label_div">
                    编号
                </div>
                <div class="input_div">
                    <input id="id" type="text" name="" value="{{$case['id']}}" readonly="readonly">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    案例类型
                </div>
                <div class="input_div">
                    <select id="case_type" class="case_type">
                        @foreach($caseTypes as $caseType)
                            <option value="{{$caseType['type_name']}}"
                                @if($caseType['type_name'] == $case['case_type'])
                                    selected 
                                @endif
                            >{{$caseType['type_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    标题
                </div>
                <div class="input_div">
                    <input id="title" type="text" name="" value="{{$case['title']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    简要
                </div>
                <div class="input_div">
                    <input id="desc" type="text" name="" value="{{$case['desc']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    发病史
                </div>
                <div class="input_div">
                    <input id="history" type="text" name="" value="{{$case['history']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    姓名
                </div>
                <div class="input_div">
                    <input id="name" type="text" name="" value="{{$case['name']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    年龄
                </div>
                <div class="input_div">
                    <input id="age" type="text" name="" value="{{$case['age']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    性别
                </div>
                <div class="input_div">
                    <input type="radio" name="sex" value="1"
                        @if($case['sex'] == 1)
                            checked 
                        @endif
                    ><div class="radio_text">男</div>
                    <input type="radio" name="sex" value="0"
                        @if($case['sex'] == 0)
                            checked 
                        @endif
                    ><div class="radio_text">女</div>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    省份
                </div>
                <div class="input_div">
                    <select id="province">
                        @foreach($provinces as $province)
                            <option value="{{$province['id']}}"
                                @if($case['province_id'] == $province['id'])
                                    selected 
                                @endif
                            >{{$province['province_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    城市
                </div>
                <div class="input_div">
                    <select id="city">
                        @foreach($citys as $city)
                            <option value="{{$city['id']}}"
                                @if($case['city_id'] == $city['id'])
                                    selected 
                                @endif
                            >{{$city['city_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    治疗方式
                </div>
                <div class="input_div">
                    <input id="manner" type="text" name="" value="{{$case['manner']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    手术时间
                </div>
                <div class="input_div">
                    <input id="time" type="date" name="" value="{{$case['time']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    身高
                </div>
                <div class="input_div">
                    <input id="height" type="text" name="" value="{{$case['height']}}">
                </div>
                <div class="unit_div">
                    CM/厘米
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div" style="vertical-align: top;margin-top: 0.1rem;">
                    案例图片
                </div>
                <div id="img-wrapper1" class="input_div">
                    <div class="img_div">
                        <img id="cn_img1" src="{{$case['picture_url']}}">
                    </div>
                    <div id="upload1_btn" class="upload_btn">
                        上传图片
                    </div>
                    <input type="file" id="upload1" style="display:none">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div" style="vertical-align: top;margin-top: 0.1rem;">
                    个案介绍
                </div>
                <div class="input_div">
                    <textarea id="introduce" style="display: none;">{{$case['introduce']}}</textarea>
                    <div id="ueditor" class="edui-default">
                        @include('UEditor::head')
                    </div>
                </div>
            </div>
        </div>
        <div class="create_title">
            <img src="/images/houtaianliku_12.png">
            术前记录
        </div>
        <div class="create_box">
            <div class="rol_div">
                <div class="label_div">
                    体重
                </div>
                <div class="input_div">
                    <input id="f_weight" type="text" name="" value="{{$case['front']['weight']}}">
                </div>
                <div class="unit_div">
                KG/千克/公斤
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    BMI值
                </div>
                <div class="input_div">
                    <input id="f_bmi" type="text" name="" value="{{$case['front']['bmi']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    血糖
                </div>
                <div class="input_div">
                    <input id="f_gi" type="text" name="" value="{{$case['front']['gi']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    腰围
                </div>
                <div class="input_div">
                    <input id="f_waistline" type="text" name="" value="{{$case['front']['waistline']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    臀围
                </div>
                <div class="input_div">
                    <input id="f_hipline" type="text" name="" value="{{$case['front']['hipline']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    肥胖等级
                </div>
                <div class="input_div">
                    <select id="f_level">
                        @foreach($levels as $level)
                            <option value="{{$level['id']}}"
                                @if($level['id'] == $case['front']['level_id'])
                                    selected 
                                @endif
                            >{{$level['level_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div" style="vertical-align: top;margin-top: 0.1rem;">
                    术前图片
                </div>
                <div id="img-wrapper2" class="input_div">
                    <div class="img_div">
                        <img id="cn_img2" src="{{$case['front']['picture_url']}}">
                    </div>
                    <div id="upload2_btn" class="upload_btn">
                        上传图片
                    </div>
                    <input type="file" id="upload2" style="display:none">
                </div>
            </div>
        </div>
        <div class="create_title">
            <img src="/images/houtaianliku_12.png">
            术后记录
        </div>
        <div class="create_box">
            <div class="rol_div">
                <div class="label_div">
                    体重
                </div>
                <div class="input_div">
                    <input id="r_weight" type="text" name="" value="{{$case['rear']['weight']}}">
                </div>
                <div class="unit_div">
                KG/千克/公斤
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    BMI值
                </div>
                <div class="input_div">
                    <input id="r_bmi" type="text" name="" value="{{$case['rear']['bmi']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    血糖
                </div>
                <div class="input_div">
                    <input id="r_gi" type="text" name=""  value="{{$case['rear']['gi']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    腰围
                </div>
                <div class="input_div">
                    <input id="r_waistline" type="text" name="" value="{{$case['rear']['waistline']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    臀围
                </div>
                <div class="input_div">
                    <input id="r_hipline" type="text" name="" value="{{$case['rear']['hipline']}}">
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div">
                    肥胖等级
                </div>
                <div class="input_div">
                    <select id="r_level">
                        @foreach($levels as $level)
                            <option value="{{$level['id']}}"
                                @if($level['id'] == $case['rear']['level_id'])
                                    selected 
                                @endif
                            >{{$level['level_name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="rol_div">
                <div class="label_div" style="vertical-align: top;margin-top: 0.1rem;">
                    术后图片
                </div>
                <div id="img-wrapper3" class="input_div">
                    <div class="img_div">
                        <img id="cn_img3" src="{{$case['rear']['picture_url']}}">
                    </div>
                    <div id="upload3_btn" class="upload_btn">
                        上传图片
                    </div>
                    <input type="file" id="upload3" style="display:none">
                </div>
            </div>
        </div>
        <div class="btn_div">
            <div class="update_btn">
                修改
            </div>
            <div class="return_btn">
                返回
            </div>
        </div>
    </div>

@stop

@section("js")
    @parent

    <script type="text/javascript" src="/js/pages/case/update.js"></script>
    <script id="ueditor"></script>
    <script>
        var ue=UE.getEditor("ueditor");
        ue.ready(function() {//编辑器初始化完成再赋值  
            ue.setContent($("#introduce").val());  //赋值给UEditor  
        });
    </script>
@stop